package com.yun.zf.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yun.zf.common.admin.domain.SysAgent;
import com.yun.zf.common.admin.dto.community.AgentInfoDto;
import com.yun.zf.common.admin.model.SysAgentEditMo;
import com.yun.zf.common.admin.model.sys.AgentAddMo;
import com.yun.zf.common.admin.model.sys.AgentBasicMo;
import com.yun.zf.common.admin.model.sys.AgentEditMo;
import com.yun.zf.common.admin.model.sys.AgentSearchMo;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface SysAgentService extends IService<SysAgent> {

    public Page<SysAgent> getAgentList (AgentSearchMo searchMo);

    public  List<SysAgent> hasAgent(long deptId);
    public SysAgentEditMo getEditInfo();

    public Boolean  motifyAgent(AgentEditMo editMo,SysAgent agent);

    public  int  addAgentAny(AgentAddMo agentMo, Long userId);

    public SysAgent checkUniAgent(String cardNo,String iphone);

    /**
     *  删除代表已离职，做删除状态，同时status状态改为1
     * @param id
     */
    public  void  motifyAgentById(Long id);

    public  SysAgent getInfoByUserId(Long userId);

    public  SysAgent getAgent(Long userId,int id);

    @Cacheable(value = "getAgentByNo" ,key = "#agentNo+'_'+#cityCode")
    public AgentInfoDto getAgentByNo(int agentNo,Long cityCode);

    @Cacheable(value = "getAgentByCommunityId" ,key = "#communityId")
    public List<AgentInfoDto>  getAgentByCommunityId(Long communityId);


    int maxAgentNo(Long cityCode);

    /**
     * 验证经纪人是否删除
     * @param agentId
     * @return
     */
    int checkIsDelFlag(int agentId);

    void changeStatus(int agentId ,int status);

    int editUser (AgentBasicMo agentMo);
    AgentBasicMo getUserBasic();
}
